package dieci.managers.clientmanager;

import dieci.database.client.ClientHibernateDAO;
import dieci.system.Client;
import java.util.List;

/**
 *
 * @author DuckSys
 */
public class ClientManager
{

    public ClientManager()
    {
        this.clientDAO = new ClientHibernateDAO();
    }

    public void saveClient(Client client)
    {
        //call dao to save the client in db
        clientDAO.saveOrUpdate(client);
    }

    public void deleteClient(Client client)
    {
        clientDAO.delete(client);
    }

    public Client find(String name)
    {
        return clientDAO.findByClientName(name);
    }

    public Client findById(int id)
    {
        return clientDAO.findById(id);
    }
    
    public List<Client> list()
    {
        return clientDAO.list();
    }
    
    private ClientHibernateDAO clientDAO;
}
